/**
 * Created by user on 2/13/19.
 */
import { DoLikeActionType } from '@act/doLikeAction'

const like_state = {
  showAnimate: false,
  lastLikeTime: 0,
  toastText: ''
}
const DoLikeState = (state = like_state, action) => {
  switch (action.type) {
    case DoLikeActionType.toggle_animate:
      return Object.assign({}, state, {
        showAnimate: action.payload.animate
      })
    case DoLikeActionType.set_last_like_time:
      return Object.assign({}, state, {
        lastLikeTime: action.payload.time
      })
    case DoLikeActionType.toggle_toast_text:
      return Object.assign({}, state, {
        toastText: action.payload.text
      })
    default:
      return state
  }
}
DoLikeState._default_state = like_state
export default DoLikeState
